package com.qf.service.impl;

import com.qf.dao.CommunityMapper;
import com.qf.pojo.Community;
import com.qf.service.CommunityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommunityServiceImpl implements CommunityService {

    @Autowired
    private CommunityMapper communityMapper;

    @Override
    public List<Community> selectByExample() {
        return communityMapper.selectByExample(null);
    }

    @Override
    public Community findById(Integer id) {
        return communityMapper.selectByPrimaryKey(id);
    }

    @Override
    public void updateCommunity(Community community) {
        communityMapper.updateByPrimaryKey(community);
    }

    @Override
    public void deleteById(Integer id) {
        communityMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void insertCommunity(Community community) {
        communityMapper.insertSelective(community);
    }
}
